// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import Client from '@api/accesscontrol/api/AccessControlUserPointApi'

import PassClass from '@api/accesscontrol/model/AccessControlUserPointAuthReq'

const RejClass = PassClass

const CLIENT = CORE.grpcCLIENT(Client)

// ============================== 导出远程接口 ============================== //

export default {
  // —————————————————————————————— 通过 —————————————————————————————— //

  async pass({ uaaUserIds }, TIP = '通过') {
    const DTO = CORE.grpcDTO(PassClass, { uaaUserIds, optType: 1 })
    await CORE.grpc(TIP, CLIENT, 'accessControlUserPointAuth', DTO)
    return CORE.grpcOK(TIP)
  },

  // —————————————————————————————— 拒绝 —————————————————————————————— //

  async rej({ uaaUserIds }, TIP = '拒绝') {
    const DTO = CORE.grpcDTO(RejClass, { uaaUserIds, optType: 2 })
    await CORE.grpc(TIP, CLIENT, 'accessControlUserPointAuth', DTO)
    return CORE.grpcOK(TIP)
  },
}
